<extend name="desktop_default/template/base_index2" />

<block name="area_header">

	<style type="text/css">
		body{background: #F5F5F5}
		.am-footer-default{background: #F5F5F5}
		.am-modal-bd{padding: 20px;}
		.am-modal-bd table tr td{padding-top: 20px;}
	</style>
</block>

<block name="area_body">
	<include file="desktop_default/width/right" />
	<include file="desktop_default/width/top"/>
	<div class="container">
		{:W('Partials/nav_group')}
	</div><br>
    <include file="desktop_default/partial/usercenter_top"/>

    <div class="div_main shop-container  am-cf">
        <div class="div_left" >
            <include file="desktop_default/width/list"/>
        </div>
		<if condition="$cfg['identity_validate'] eq 0">
			<div class="div_right" >
				<font size="5" color="red">实名认证(未认证)
				</font><br><br>
				<hr>
				<form method="post" class="smfm">
				<font>真实姓名：<input value="{$user['realname']}" type="text" class="am-form-field" id="realname" name="realname" style="height: 30px; width: 250px;" /><br><span></span></font><br>
				<font>身份证号：<input value="{$user['idnumber']}" type="text" class="am-form-field" id="idnumber" name="idnum" style="height: 30px; width: 250px;" /><br><span></span></font><br><br>
				<font size="3" color="red">此信息必须为真实有效且与收货联系人身份一致,否则将导致无法发货!</font><br><br>
				<button class="am-btn-primary ajax-post" target-form="smfm" url="{:U('Shop/User/truename')}" style="border: 0; padding: 5px;">确认提交</button>
				</form>
			</div>
		</if>
		<if condition="$cfg['identity_validate'] eq 1">
			<div class="div_right" >
                <div class="title">实名认证</div>
                <div >{$user['realname']}<span style="font-size: 1rem; padding: 3px;" class="am-alert am-margin-left-sm"><i class="am-icon-check"></i>已认证</span></div>
                <div >{$user['idnumber']}<span style="font-size: 1rem; padding: 3px;"  class="am-alert am-margin-left-sm"><i class="am-icon-check "></i>已认证</span></div>
				<hr>
				<form method="post" class="smfm">
					<font>真实姓名：<input type="text" id="realname" class="am-form-field" name="realname" style="height: 30px; width: 250px;" /><br><span></span></font><br>
					<font>身份证号：<input type="text" id="idnum" class="am-form-field" name="idnumber" style="height: 30px; width: 250px;" /><br><span></span></font><br><br>
					<button class="am-btn-primary am-btn am-btn-sm ajax-post" target-form="smfm" url="{:U('Shop/User/truename')}" >重新提交</button>
				</form>
			</div>
		</if>
		<if condition="$cfg['identity_validate'] eq 2">
			<div class="div_right" style="width: 800px; text-align: center;">
				<font size="5" color="blue">实名认证(等待审核)
				</font>
				请耐心等待后台审核
			</div>
		</if>
	</div>
	 <include file="desktop_default/width/floor" />
	<hr  style="border: none; clear:both"/>
</block>

<block name="area_footer">
<script type="text/javascript">
	$(function(){
		$('#realname').blur(function(){ 
			if($(this).val()==''){
				$(this).parent().find("span").html("<font color='red'>姓名不能为空！</font>");
			}else{
				$(this).parent().find("span").html("<font color='green'>姓名正确！</font>");
			}
		})
		$('#idnum').blur(function(){
			var num=/^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/;
			if(num.test($(this).val())){
				$(this).parent().find("span").html("<font color='green'>正确！</font>");
			}else{
				$(this).parent().find("span").html("<font color='red'>不正确！</font>");
			}
		})
		
		
				
	})
</script>
</block>